<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>
        
    </style>
</head>
<body>
    <div id="app">
        <!-- {{msg}} -->
        <h4 >{{msg}} </h4>
        <p ref="zero">{{a}} </p>
        <p>{{b}} </p>

    </div>
    
</body>

<script>
    var data = {
        msg:"嗨,boys",
        a:1,
        b:100

    }
    // Object.freeze(data)  数据冻结  冻结后不能修改

    var count =0;

    const vm = new Vue({
        el:"#app",
        data:data,
        methods:{
           
        },
        beforeCreate(){
            console.log(this);
            console.log(`##${++count} - beforeCreate - 实例创建之前`);
        },
        created(){
            console.log(`created - 实例创建完成`);
        },
        beforeMount(){
            this.log(`beforeMount - 实例载入到根DOM之前`)
        },
        mounted(){
            // mounted 才有真是的DOM,这之前都是虚拟DOM
            this.$refs.zero.style.color = "blue"
        },
        beforeUpdate(){
            this.log(`brforeUpdate - 实例化数据更新之前`)
        },
        Update(){
            this.log(`Updated - 实例化数据更新完毕`)
        },
        beforeDestroy(){
            this.log(`brforeDestroy - 实例被销毁之前`)
        },
        destroyed(){
            this.log(`destroyed - 实例被销毁完成`)
        },
        activated(){
            this.log(`activated - 实例被激活`)
        },
        deactivated(){
            this.log(`deactivated - 实例失活`)
        }
    })
</script>
</html>